#include <iostream>
#include <deque>

template<typename T>
void Print(const T &d)
{
    //遍历:迭代器的遍历容器的方式
    //前向迭代器
    for(auto ite = d.begin(); ite != d.end(); ite++)
    {
        std::cout<<*ite<<" ";
    }
    std::cout<<std::endl;
}


int main()
{
    std::deque<int> d;
    d.push_back(1);
    d.push_back(2);
    d.push_front(3);
    d.push_front(4);

    

    Print(std::deque<int>(d));
    return 0;
}